Red Hat Enterprise Linux Implementation

Local and Remote Logins

Module Topics

  • Local Console Command Line Access

  • Bash Shell

  • Virtual Consoles

  • Shell Basics

  • SSH Key-Based Authentication

  • SSH Key Generation

  • Red Hat Customer Portal

  • Knowledgebase

  • Support Cases

  • Advanced Diagnostics

Local Console Command Line Access

  • Command line: Text-based interface used to input instructions to computer system

  • Linux command line provided by shell

  • GNU Bourne-Again Shell (bash): Default shell in Red Hat Enterprise Linux

    • Improved version of Bourne Shell (sh)

Bash Shell

  • Shell prompt displays when shell is waiting for command from user

    • When regular user starts shell, default prompt ends with $:

      [student@desktop1 ~]$
    • When superuser (root) starts shell, default prompt ends with #:

      [root@desktop1 ~]#
  • bash shell provides scripting language for automating tasks

  • Shell can simplify operations that are hard to accomplish with graphical tools

Virtual Consoles

Terminal Access
  • Provides keyboard for input and display for output

  • On text-based installations, can be Linux machine’s physical console

  • Can be configured through serial ports

Virtual Console Access
  • Linux machine’s physical console supports multiple virtual consoles

  • Each virtual console acts like separate terminal

    • Supports independent login session

    • GUI runs on first virtual console

    • In GUI, hold Ctrl+Alt and press F2 through F6 to access text login prompt for consoles 2 - 6

    • Press Ctrl+Alt+F1 to return to first virtual console and GUI desktop.

Shell Basics

  • Commands entered at shell prompt have three basic parts:

    • Command: Name of program to run

    • Options: Adjust behavior of command and normally start with one or two dashes (-a or --all)

    • Arguments: Often indicate target that command should operate on

  • Commands can be followed by one or more options or arguments

    usermod -L morgan
    • Command is usermod

    • Option is -L

    • Argument is morgan

Shell Basics

  • Most commands have --help option that prints usage statement

  • Usage statement conventions:

    • [] surrounds optional items

    • ... represents an arbitrary-length list of items of that type

    • | separates items when only one item can be specified

    • <> represents variable data

      • Example: <filename> means “insert the filename you wish to use here”

        Sometimes variables appear as capital letters (e.g., FILENAME).

Shell Basics

[student@desktop1 ~]$ date --help
date [OPTION]... [+FORMAT]
  • date takes optional list of options: [OPTION]...

  • Options are followed by optional format string: [+FORMAT]

  • To quit shell and end session, do one of the following:

    • Use exit

    • Press Ctrl+D

References
  • Man pages: intro(1), bash(1), console(4), pts(4), and man-pages(7)

Some details of the console(4) man page, involving init(8) and inittab(5), are outdated.

SSH Key-Based Authentication

  • Key-based SSH authentication adds additional security to remote systems administration

  • Users can authenticate SSH login without password

    • Authenticate using private-public key scheme

  • Two keys are generated: private key and public key

    • Private key file used as authentication credential

      • Like password, must be kept secret and secure

    • Public key used to verify the private key

      • Copied to systems user wants to log in to

      • Does not need to be secret

  • SSH server with public key can issue challenge that only system holding private key can answer

    • Allows secure system access without requiring password every time

SSH Key Generation

  • To generate keys, use ssh-keygen

    • Generates private key ~/.ssh/id_rsa and public key ~/.ssh/id_rsa.pub

  • Optional, specify passphrase during generation

    • Passphrase must be provided to access private key

    • Difficult to use stolen key without passphrase

    • With passphrase, SSH is no longer password-less

  • To provide passphrase once at start of session, use ssh-agent with ssh-add

    • Provides passphrase as needed while you stay logged in

Tip: Additional information for the ssh-agent command can be found consulting the Red Hat System Administration Guide.

SSH Key Generation

  • Generated SSH keys are stored by default in .ssh/ directory of home directory

    • Private key permissions should be 600

    • Public key permissions should be 644

  • To use key-based authentication, public key must be copied to destination system

    • Use ssh-copy-id

    • Copies ~/.ssh/id_rsa.pub file by default

      [student@desktop1 ~]$ ssh-copy-id root@student1.example.com

SSH Key Generation

[student@desktop1 ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/student/.ssh/id_rsa):Enter
Created directory '/home/student/.ssh'.
Enter passphrase (empty for no passphrase):r3dh@t1!
Enter same passphrase again:r3dh@t1!
Your identification has been saved in /home/student/.ssh/id_rsa.
Your public key has been saved in /home/student/.ssh/id_rsa.pub.
The key fingerprint is:
a4:9:cf:fb:ac:ab:c8:ce:45:33:f2:ad:69:7b:d2:5a student@desktop1.example.com
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|      . .        |
|     . *         |
|    . * S        |
|     + + .       |
|      o.E        |
|   o oo+oo       |
|   .=.**ooo      |
+-----------------+

SSH Key Generation

[student@desktop1 ~]$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@server1.example.com
References

Red Hat Customer Portal

  • Access Red Hat Customer Portal at https://access.redhat.com

  • Access everything provided with subscription in one location:

    • Search Knowledgebase for solutions, FAQs, and articles

    • Access official product documentation

    • Submit and manage support tickets

    • Attach and detach product subscriptions

    • Download software, updates, and evaluations

  • Parts of site accessible to everyone

    • Other parts are exclusive to customers with active subscriptions

  • Get help with Customer Portal at https://access.redhat.com/help/

Knowledgebase

  • Can access Red Hat Customer Portal via web browser:

    Knowledgebase
  • Can access Red Hat Customer Portal via command line tool:

    [student@desktop1 ~]$ redhat-support-tool
    Welcome to the Red Hat Support Tool.
    Command (? for help):
    • Access from any terminal or SSH connection

    • Use as interactive shell (default) or execute individual commands with options and arguments

      • Syntax identical for both methods

    • To see all available commands, use help

    • Shell mode supports:

      • Tab completion

      • Calling programs in parent shell

Knowledgebase

  • When first invoked, redhat-support-tool prompts for subscriber login information

    • To avoid repetitively supplying credentials, tool asks to store account info in $HOME/.redhat-support-tool/redhat-support-tool.conf

    • If account is shared by many users, use --global option to save account info and systemwide configuration to /etc/redhat-support-tool.conf

  • To modify tool’s configuration settings, use config

Knowledgebase

[student@desktop1 ~]$ redhat-support-tool
Welcome to the Red Hat Support Tool.
Command (? for help):search How to manage system entitlements with subscription-manager
Please enter your RHN user ID:subscriber
Save the user ID in /home/student/.redhat-support-tool/redhat-support-tool.conf (y/n):y
Please enter the password for subscriber:password
Save the password for subscriber in /home/student/.redhat-support-tool/redhat-support-tool.conf (y/n):y
Type the number of the solution to view or 'e' to return to the previous menu.
  1 [ 253273:ER] How to register and subscribe a system to Red Hat Network
    (RHN) using Red Hat Subscription Manager (RHSM)?
  2 [  17397:ER] What are Flex Guest Entitlements in Red Hat Network?
  3 [ 232863:ER] How to register machines and manage subscriptions using Red
    Hat Subscription Manager through an invisible HTTP proxy / Firewall?
3 of 43 solutions displayed. Type 'm' to see more, 'r' to start from the beginning again, or '?' for help with the codes displayed in the above output.
Select a Solution:1

Type the number of the section to view or 'e' to return to the previous menu.
 1 Title
 2 Issue
 3 Environment
 4 Resolution
 5 Display all sections
End of options.
Section:1

Title
===============================================================================
How to register and subscribe a system to Red Hat Network (RHN) using Red Hat Subscription Manager (RHSM)?
URL:       https://access.redhat.com/site/solutions/253273
(END) q
[student@desktop1 ~]$

Knowledgebase

Access Knowledgebase Articles by Document ID
  • To locate articles by document ID, use kb

  • Returned documents scroll on screen without pagination

    • Allows redirect of output with local commands

      [student@desktop1 ~]$ redhat-support-tool kb 253273 | less
      
      Title:  How to register and subscribe a system to Red Hat Network (RHN) using Red Hat Subscription Manager (RHSM)?
      ID:     253273
      State:  Verified: This solution has been verified to work by Red Hat Customers and Support Engineers for the specified product version(s).
      URL:    https://access.redhat.com/site/solutions/253273
      :q

Support Cases

Prepare Bug Reports
  1. Define problem

    • Clearly state problem and symptoms

    • Be as specific as possible

    • Document steps to reproduce problem

  2. Gather background information

    • Product and version affected

    • Provide relevant diagnostic info, such as output of sosreport, system’s kdump crash dump, or digital photo of kernel backtrace displayed on monitor

  3. Determine severity level

Support Cases

Severity Level

Description

Urgent (Severity 1)

A problem that severely impacts your use of the software in a production environment (such as loss of production data or in which your production systems are not functioning). The situation halts your business operations and no procedural workaround exists.

High (Severity 2)

A problem where the software is functioning but your use in a production environment is severely reduced. The situation is causing a high impact to portions of your business operations and no procedural workaround exists.

Medium (Severity 3)

A problem that involves partial, non-critical loss of use of the software in a production environment or development environment. For production environments, there is a medium-to-low impact on your business, but your business continues to function, including by using a procedural workaround. For development environments, where the situation is causing your project to no longer continue or migrate into production.

Low (Severity 4)

A general usage question, reporting of a documentation error, or recommendation for a future product enhancement or modification. For production environments, there is low-to-no impact on your business or the performance or functionality of your system. For development environments, there is a medium-to-low impact on your business, but your business continues to function, including by using a procedural workaround.

Support Cases

Manage Bug Reports
  • Subscribers can use redhat-support-tool to create, view, modify, and close support cases

  • Attach files or documentation, such as diagnostic reports (sosreport)

  • Use command options or tool prompts to provide case details including product, version, summary, description, severity, and case group

    [student@desktop1 ~]$ redhat-support-tool
    Welcome to the Red Hat Support Tool.
    Command (? for help):opencase --product="Red Hat Enterprise Linux" --version="7.0"
    Please enter a summary (or 'q' to exit):System fails to run without power
    Please enter a description (Ctrl-D on an empty line when complete):
    When the server is unplugged, the operating system fails to continue.
     1   Low
     2   Normal
     3   High
     4   Urgent
    Please select a severity (or 'q' to exit):4
    Would you like to assign a case group to this case (y/N)? N
    Would see if there is a solution to this problem before opening a support case? (y/N) N
    -------------------------------------------------------------------------------
    Support case 01034421 has successfully been opened.

Support Cases

Attach an SoS Report
  • Use sosreport to generate tar archive of diagnostic info gathered from running system

  • redhat-support-tool prompts to include SoS report if an archive exists

    Please attach a SoS report to support case 01034421. Create a SoS report as
    the root user and execute the following command to attach the SoS report
    directly to the case:
     redhat-support-tool addattachment -c 01034421 path to sosreport
    
    Would you like to attach a file to 01034421 at this time? (y/N) N
    Command (? for help):
  • If current SoS report is not available, administrator can generate and attach later using addattachment

Support Cases

Manage Bug Reports
Command (? for help):listcases

Type the number of the case to view or 'e' to return to the previous menu.
 1 [Waiting on Red Hat]  System fails to run without power
No more cases to display
Select a Case:1

Type the number of the section to view or 'e' to return to the previous menu.
 1 Case Details
 2 Modify Case
 3 Description
 4 Recommendations
 5 Get Attachment
 6 Add Attachment
 7 Add Comment
End of options.
Option:q

Select a Case:q

Command (? for help):

[student@desktop1 ~]$ redhat-support-tool modifycase --status=Closed 01034421
Successfully updated case 01034421
[student@desktop1 ~]$

Advanced Diagnostics

  • Red Hat Support Tool can use kernel crash dump core files to create and extract a backtrace

    • Report of active stack frames at point of crash dump

    • Provides onsite diagnostics

    • Useful when opening support case

  • Use analyze to view many types of log files, including operating system, JBoss®, Python, Tomcat, oVirt, and others

    • Parse files to identify problem symptoms

    • View and diagnose parsed files individually

    • Provide preprocessed analysis as support case attachment

Summary

  • Local Console Command Line Access

  • Bash Shell

  • Virtual Consoles

  • Shell Basics

  • SSH Key-Based Authentication

  • SSH Key Generation

  • Red Hat Customer Portal

  • Knowledgebase

  • Support Cases

  • Advanced Diagnostics

Module Completion

Nice job!

Click the button below to complete this module of the course: